# 11. 环中最长子串
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let inputs = [];
rl.on('line', (input) => {
const len = input.length;
let num = 0;
for(let v of input) {
if(v === 'o') {
num++;
}
}
if (num % 2 === 0) {
console.log(len);
} else {
console.log(len - 1);
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
← 10. 找出作弊的人 12. 找座位 →